Class TKRect
The TKRect provides some utilities to deal with a rectangle data type, allowing to obtain coordinates of the rectangle's points
of interest as TKPoint objects and its edges as TKSegment objects, or obtaining a rectangle resulting in the union of several others.
Defined in: Utils.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
TKRect(x, y, width, height)
|
| Field Attributes | Field Name and Description |
|---|---|
|
The height.
|
|
|
The width.
|
|
|
The x coordinate.
|
|
|
The y coordinate.
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
TKRect.
rectFromClientRect(rect)
Returns a
TKRect from a rectangle returned by the Node.getBoundingClientRect method. |
Class Detail
TKRect(x, y, width, height)
- Parameters:
- {float} x
- The x coordinate.
- {float} y
- The y coordinate.
- {float} width
- The width.
- {float} height
- The height.
- Since:
- TuneKit 1.0
Field Detail
{float}
height
The height.
{float}
width
The width.
{float}
x
The x coordinate.
{float}
y
The y coordinate.
Method Detail
<static>
{
TKRect}
TKRect.rectFromClientRect(rect)
Returns a
TKRect from a rectangle returned by the Node.getBoundingClientRect method.
- Parameters:
- {ClientRect} rect
- The CSS client rectangle.
- Returns:
- {
TKRect} The equivalent rectangle as a TuneKit data type.